{template 'common/header-gw'}
<ol class="breadcrumb">
	<li><a href="./?refresh"><i class="fa fa-home"></i></a></li>
	<li><a href="{url 'system/welcome'}">系统</a></li>
	<li class="active">查看用户权限</li>
</ol>
<ul class="nav nav-tabs">
	<li><a href="{php echo url('user/display');}">用户列表</a></li>
	<li><a href="{php echo url('user/create');}">添加用户</a></li>
	<li><a href="{url 'user/edit' array('uid' => $uid)}">编辑用户</a></li>
	<li class="active"><a href="{php echo url('user/permission', array('uid' => $uid));}">查看用户权限</a></li>
</ul>

<div class="clearfix">
	<div class="form form-horizontal" >
		<div class="panel panel-default">
			<div class="panel-heading">用户组基本权限</div>
			<div class="panel-body table-responsive">
				<table class="table table-hover">
					<tr>
						<td style="width:250px">用户组名</td>
						<td>
							<p class="form-control-static">{$group['name']}&nbsp;&nbsp;<a href="{php echo url('user/group/post', array('id' => $group['id']));}" title="编辑当前用户所在用户组"><i class="fa fa-edit"></i></a></p>
						</td>
					</tr>
					<tr>
						<td>最多公众号数量</td>
						<td>{$group['maxaccount']}</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="panel panel-default">
			<div class="panel-heading">可使用公众号</div>
			<div class="panel-body table-responsive">
				<table class="table table-hover">
					<thead>
					<tr>
						<th style="width:250px;">公众号</th>
						<th>角色</th>
						<th style="width:450px;">操作</th>
					</tr>
					</thead>
					<tbody>
					{loop $wechats $item}
					<tr>
						<td>{$item['name']}</td>
						<td>{if $weids[$item['uniacid']]['role'] == 'operator'}<span class="label label-success">操作员{else}<span class="label label-info">管理员{/if}</span></td>
						<td><a href="{url 'account/post' array('uniacid' => $item['uniacid'])}" target="_blank">编辑公众号</a>&nbsp;|&nbsp;<a href="{url 'account/permission' array('uniacid' => $item['uniacid'], 'fromuid' => $uid)}" target="_blank">编辑权限</a></td>
					</tr>
					{/loop}
					</tbody>
				</table>
			</div>
		</div>
		<div class="panel panel-default">
			<div class="panel-heading">当前用户所在用户组可使用的公众号权限</div>
			<div class="panel-body table-responsive">
				<table class="table table-hover">
					<thead>
						<tr>
							<th style="width:250px;">公众服务套餐</th>
							<th>模块权限</th>
							<th style="width:450px;">模板权限</th>
						</tr>
					</thead>
					<tbody>
					{loop $group['package'] $item}
					<tr>
						<td style="line-height:30px;width:250px;">{$item['name']}</td>
						<td style="line-height:30px; white-space:normal;">
							<span class="label label-success">系统模块</span>
							{loop $item['modules'] $module}
							<span class="label label-info">{$module['title']}</span>
							{/loop}
						</td>
						<td style="line-height:30px; white-space:normal;">
							<span class="label label-success">微站默认模板</span>
							{loop $item['templates'] $template}
							<span class="label label-info">{$template['title']}</span>
							{/loop}
						</td>
					</tr>
					{/loop}
					</tbody>
				</table>
			</div>
		</div>
		<div class="form-group">
			<div class="col-xs-12 col-sm-10 col-md-10 col-lg-10">
				<a class="btn btn-primary" href="{url 'user/edit' array('uid' => $uid)}">编辑当前用户资料</a>
			</div>
		</div>
	</div>
</div>
{template 'common/footer-gw'}
